#include "CaptureVideoTrackSource.h"

rtc::scoped_refptr<CaptureVideoTrackSource> CaptureVideoTrackSource::create(
        const int &iWidth, const int &iHeight, const int &iFPS, const QString &strID)
{
    return new rtc::RefCountedObject<CaptureVideoTrackSource>(iWidth, iHeight, iFPS, strID, nullptr);
}

rtc::VideoSourceInterface<webrtc::VideoFrame> *CaptureVideoTrackSource::source()
{
    return &m_cameraVideoCapture;
}

CaptureVideoTrackSource::CaptureVideoTrackSource(
        const int &iWidth, const int &iHeight, const int &iFPS, const QString &strID, QObject *parent)
    : QObject(parent),
      webrtc::VideoTrackSource(false)
{
    m_cameraVideoCapture.init(iWidth, iHeight, iFPS, strID);
}
